<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->string('phone', 100);
            $table->string('user_name', 100);
            $table->string('email', 100);
            $table->char('password', 32);
            $table->string('headpic');
            $table->char('disable', 1)->default('N')->comment('N 可登录 / Y 不可登录');
            $table->char('role', 2)->default('U')->comment('U(user), A(author), R(admin(root))');
            $table->integer('coupon')->default(0);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
